Trees of classifiers for detecting email spam

ABSTRACT

Decision trees populated with classifier models are leveraged to provide enhanced spam detection utilizing separate email classifiers for each feature of an email. This provides a higher probability of spam detection through tailoring of each classifier model to facilitate in more accurately determining spam on a feature-by-feature basis. Classifiers can be constructed based on linear models such as, for example, logistic-regression models and/or support vector machines (SVM) and the like. The classifiers can also be constructed based on decision trees. &#34;Compound features&#34; based on internal and/or external nodes of a decision tree can be utilized to provide linear classifier models as well. Smoothing of the spam detection results can be achieved by utilizing classifier models from other nodes within the decision tree if training data is sparse. This forms a base model for branches of a decision tree that may not have received substantial training data.

BACKGROUND

The advent of global communications networks such as the Internet has presented commercial opportunities for reaching vast numbers of potential customers. Electronic messaging (“email”) is becoming increasingly pervasive as a means for disseminating unwanted advertisements and promotions (also denoted as “spam”) to network users. The Radicati Group, Inc., a consulting and market research firm, estimates that as of August 2002, two billion junk email messages are sent each day—this number is expected to triple every two years. Individuals and entities (e.g., businesses, government agencies) are becoming increasingly inconvenienced and oftentimes offended by junk messages. As such, junk email is now or soon will become a major threat to trustworthy computing.

A key technique utilized to thwart junk email is employment of filtering systems/methodologies. One proven filtering technique is based upon a machine learning approach—machine learning filters assign to an incoming message a probability that the message is junk. In this approach, features typically are extracted from two classes of example messages (e.g., junk and non-junk messages), and a learning filter is applied to discriminate probabilistically between the two classes. Since many message features are related to content (e.g., words and phrases in the subject and/or body of the message), such types of filters are commonly referred to as “content-based filters.”

Some junk/spam filters are adaptive, which is important in that multilingual users and users who speak rare languages need a filter that can adapt to their specific needs. Furthermore, not all users agree on what is and is not, junk/spam. Accordingly, by employing a filter that can be trained implicitly (e.g., via observing user behavior) the respective filter can be tailored dynamically to meet a user's particular message identification needs.

One approach for filtering adaptation is to request a user(s) to label messages as junk and non-junk. Unfortunately, such manually intensive training techniques are undesirable to many users due to the complexity associated with such training let alone the amount of time required to properly effect such training. In addition, such manual training techniques are often flawed by individual users. For example, subscriptions to free mailing lists are often forgotten about by users and thus, can be incorrectly labeled as junk mail by a default filter. Since most users may not check the contents of a junk folder, legitimate mail is blocked indefinitely from the user's mailbox. Another adaptive filter training approach is to employ implicit training cues. For example, if the user(s) replies to or forwards a message, the approach assumes the message to be non-junk. However, using only message cues of this sort introduces statistical biases into the training process, resulting in filters of lower respective accuracy.

Despite various training techniques, spam or junk filters are far from perfect and, quite often, misclassify electronic messages. Unfortunately, this can result in a few junk messages appearing in the inbox and a few good messages lost in a junk folder. Users may mistakenly open spam messages delivered to their inbox and as a result expose them to lewd or obnoxious content. In addition, they may unknowingly “release” their email address to the spammers via web beacons. Improvements in spam filtering are highly desirable in order to facilitate in reducing or even eliminating these unwanted emails.

SUMMARY

The following presents a simplified summary of the subject matter in order to provide a basic understanding of some aspects of subject matter embodiments. This summary is not an extensive overview of the subject matter. It is not intended to identify key/critical elements of the embodiments or to delineate the scope of the subject matter. Its sole purpose is to present some concepts of the subject matter in a simplified form as a prelude to the more detailed description that is presented later.

The subject matter relates generally to email classification, and more particularly to systems and methods for detecting email spam. Decision trees populated with classifier models are leveraged to provide enhanced spam detection utilizing separate email classifiers for each feature of an email. This provides a higher probability of spam detection through tailoring of each classifier model to facilitate in more accurately determining spam on a feature-by-feature basis. Classifiers can be constructed based on linear models such as, for example, logistic-regression models and/or support vector machines (SVM) and the like. The classifiers can also be constructed based on decision trees. “Compound features” based on internal and/or external nodes of a decision tree can be utilized to provide linear classifier models as well. Smoothing of the spam detection results can be achieved by utilizing classifier models from other nodes within the decision tree if training data is sparse. This forms a base model for branches of a decision tree that may not receive substantial training data.

To the accomplishment of the foregoing and related ends, certain illustrative aspects of embodiments are described herein in connection with the following description and the annexed drawings. These aspects are indicative, however, of but a few of the various ways in which the principles of the subject matter may be employed, and the subject matter is intended to include all such aspects and their equivalents. Other advantages and novel features of the subject matter may become apparent from the following detailed description when considered in conjunction with the drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an email classification system in accordance with an aspect of an embodiment.

FIG. 2 is another block diagram of an email classification system in accordance with an aspect of an embodiment.

FIG. 3 is yet another block diagram of an email classification system in accordance with an aspect of an embodiment.

FIG. 4 is an illustration of an example decision tree splitting on email length and recipient number in accordance with an embodiment.

FIG. 5 is an illustration of a sample decision tree in accordance with an aspect of an embodiment.

FIG. 6 is an illustration of a graph that depicts test results utilizing a decision tree learning algorithm to improve the performance on text data in accordance with an aspect of an embodiment.

FIG. 7 is an illustration of depth 5 decision tree learned splits in accordance with an aspect of an embodiment.

FIG. 8 is a flow diagram of a method of facilitating email classification in accordance with an aspect of an embodiment.

FIG. 9 is a flow diagram of a method of constructing an email decision tree that facilitates email classification in accordance with an aspect of an embodiment.

FIG. 10 is a flow diagram of a method of constructing classifiers for utilization in email classification in accordance with an aspect of an embodiment.

FIG. 11 illustrates an example operating environment in which an embodiment can function.

FIG. 12 illustrates another example operating environment in which an embodiment can function.

DETAILED DESCRIPTION

The subject matter is now described with reference to the drawings, wherein like reference numerals are used to refer to like elements throughout. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the subject matter. It may be evident, however, that subject matter embodiments may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to facilitate describing the embodiments.

As used in this application, the term “component” is intended to refer to a computer-related entity, either hardware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a server and the server can be a computer component. One or more components may reside within a process and/or thread of execution and a component may be localized on one computer and/or distributed between two or more computers. A “thread” is the entity within a process that the operating system kernel schedules for execution. As is well known in the art, each thread has an associated “context” which is the volatile data associated with the execution of the thread. A thread's context includes the contents of system registers and the virtual address belonging to the thread's process. Thus, the actual data comprising a thread's context varies as it executes.

The subject matter utilizes a class of models to detect whether or not an email is spam. In particular, a tree of classifiers is employed for email classification where the internal nodes of the tree correspond to features and each out-going edge from an internal node corresponds to a value for that feature. Within each leaf of the tree is a separate classifier. Thus, the decision tree facilitates in determining which classifier is utilized to determine if the email is likely to be spam. Overall classification accuracy is increased by dividing emails into a plurality of partitions and employing a classifier tailored for that specific partition. The partitioning is based on features of the emails such as, for example, length, font size, word choice, sender, and/or subject line and the like. For example, the length of an email message and the number of recipients can be utilized to dictate that different classifiers are employed to optimize the classification of each feature.

One skilled in the art can appreciate that the techniques described infra can also be augmented with preprocessing, for example, to remove commented and/or otherwise invisible text, etc. from HTML and other formatted emails to enhance spam detection. This facilitates to prevent spammers from hiding classification features inside the emails in order to sway detection results. User interfaces and/or automated techniques can also be incorporated to facilitate in personalizing and/or updating the infra techniques. This can be accomplished, for example, by collecting user data such as, for example, hand classified spam or desired emails as well as other data such as, for example, emails responded to and emails not responded to. This type of data can be utilized to facilitate the training of trees of classifiers. Personalization makes it much harder for spammers to defeat filtering techniques because every user has a different filter. The augmented techniques can also include white lists that contain, for example, email addresses that should not be categorized as spam regardless of classification. Automated data collection, features such as reverse IP lookups for address fraud, and/or challenges (requests of postage—computation and/or monetary) and the like are some additional techniques that can be utilized to augment the trees of classifiers to facilitate performance as well.

In FIG. 1, a block diagram of an email classification system 100 in accordance with an aspect of an embodiment is shown. The email classification system 100 is comprised of an email classifier component 102 that receives an input 104 and provides an output 106. The email classifier component 102 receives the input 104 which is comprised of at least one message such as, for example, an email message. It 102 then determines features of the input 104 and utilizes at least one message feature classifier employed via a decision tree to classify the input 104. The classified message is then provided as the output 106. The message features can include message length, message text font size, message sender, message sent time-of-day, and/or message text and the like. The decision tree utilized by the email classifier component 102 contains nodes that allow splits based upon each feature. Generally speaking, the splits are binary such as, for example, “is message length>50 words” has two answers—less than or equal to 50 words and greater than 50 words. Separate classifiers can then be utilized in the leaves of the decision tree for each feature. This allows greater tailoring of the email classifier component 102 and increased spam detection probabilities.

Looking at FIG. 2, another block diagram of an email classification system 200 in accordance with an aspect of an embodiment is depicted. The email classification system 200 is comprised of an email classifier component 202 that receives email 204 and provides classified email 206. The email classifier component 202 is comprised of a feature detection component 208 and a decision tree classification component 210 that interfaces with classifier model(s) 212. The feature detection component 208 receives the email 204 and detects at least one feature of the email 204. The decision tree classification component 210 utilizes the detected feature(s) received from the feature detection component 208 to facilitate in classifying the email 204. It 210 employs at least one classifier model(s) 212 via a decision tree that splits on the features of the email 204. The leaves of the decision tree are classifiers that are tailored to a specific email feature. The classifiers themselves can be different types such as, for example, linear classifiers and/or even other decision trees and the like. Linear classifiers utilized by the email classifier component 202 can include, but are not limited to, support vector machines (SVM) and/or logistic-regression classifiers and the like.

The decision tree classification component 210 employs the decision tree to determine an optimum classifier to utilize for evaluation of the email 204. Once the email 204 is classified, the decision tree classification component 210 provides the classified email 206 as an output. The classified email 206 can represent a spam classified email and/or other types of classified email such as “move,” “delete,” and/or “ignore” email and the like. In other words, the email 204 can be processed by one instance of the email classification system 200 to determine if the email 204 is spam. In another personalized instance of the email classification system 200, the email 204 can be determined to not be spam, but can be categorized as unimportant to a user. In this scenario, the email 204 may be classified as spam, move, delete, and/or ignore and the like by the user.

Turning to FIG. 3, yet another block diagram of an email classification system 300 in accordance with an aspect of an embodiment is illustrated. The email classification system 300 is comprised of an email classifier component 302 that receives email 304 and provides classified email 306. The email classifier component 302 is comprised of a feature detection component 308 and a decision tree classification component 310 that interfaces with classifier model(s) 312, email features 314, and/or training data 316. The feature detection component 308 receives the email 304 and detects at least one feature of the email 304. The decision tree classification component 310 utilizes the detected features received from the feature detection component 308 to facilitate in classifying the email 304. It 310 employs at least one classifier model(s) 312 via a decision tree that splits on the features of the email 304. The decision tree(s) are constructed utilizing email features 314 and training data 316. The internal nodes in the decision tree are tests on features of the email 304. However, not all features of the email 304 are necessarily represented in splits in the tree, and, typically, the vast majority of the features are not utilized. The leaf classifiers are generally functions of the other features of the email 304, and these “leaf specific” features facilitate in classifying the email 304. In a typical instance, the decision tree is constructed from scratch using the training data 316. In addition, classifiers can be constructed from other classifiers utilized in the nodes of the decision tree to facilitate in smoothing the classification results. Linear classifiers constructed from “compound features” of internal and/or external nodes of the decision tree can be employed as spam detectors as well.

The leaves (i.e., classifiers) of the decision tree are be tailored to email containing specific features. The classifiers themselves can be different types such as, for example, linear classifiers and/or even other decision trees and the like. Linear classifiers utilized by the email classifier component 302 can include, but are not limited to, support vector machines (SVM) and/or logistic-regression classifiers and the like. The decision tree classification component 310 employs the decision tree to determine an optimum classifier to utilize for evaluation of the email 304. Once the email 304 is classified, the decision tree classification component 310 provides the classified email 306 as an output. The classified email 306 can represent a spam classified email and/or other types of classified email such as “move,” “delete,” and/or “ignore” email and the like. In other words, the email 304 can be processed by one instance of the email classifier component 302 to determine if the email 304 is spam. In another personalized instance of the email classification system 300, the email 304 can be determined to not be spam, but can be categorized as unimportant to a user. In this scenario, the email 304 may be classified as spam, move, delete, and/or ignore and the like by the user

Thus, this technology provides a simple generalization of spam classification where a decision tree is utilized to facilitate in the determination of which classifier to use for a given feature. Separate classifiers are then employed based on a feature-by-feature basis, increasing the accuracy of the spam detection. For example, suppose that depending on the length of an email message and the number of recipients, the best classifier to use may be different. An example decision tree 400 with a root node 402, child node 404, and leaf nodes 406-410 for this situation is illustrated in FIG. 4.

To classify a particular email, the process starts at the root node 402 of the decision tree 400. Because the root node 402 is an internal node, the process looks at the corresponding feature of the email, namely its length. Suppose the email has 1000 characters, and therefore the process traverses to the right child node 404 of the root node 402. The process then looks at the number of recipients on the email, and assuming there is exactly one, the process traverses the left child and ends at the “Classifier 2” leaf node 406. The process then classifies the email using the classifier corresponding to this leaf node 406. The subject matter allows any type of classifier to be used in the leaf nodes 406-410, including a decision tree classifier. One instance utilizes a logistic-regression classifier in the leaves, which is of the same form as an SVM but is trained differently.

Data sparsity can become a problem with a decision tree of classifiers. For example, the bottom nodes might be trained on only one fourth as many examples as a normal classifier would be trained on, generally meaning that there is not enough data to do an accurate job. Some words might not appear at all in many messages in a leaf node. This can be alleviated by smoothing across nodes. For example, a linear classifier corresponding to an internal node of the tree can be trained based on all data relevant to that node and can be utilized as a “prior” for the nodes below it. The final classification of an email would be a function of all of the classifiers within the tree that are on the path from the root node to the leaf.

If a decision tree consists of linear classifiers, the entire tree can often be converted into a single linear model by creating “compound” features that incorporate the structure of the tree. For example, for the tree 400 above, the weight for the feature word “click” in Classifier 1 408 might be C₁. For Classifier 2 406 it would be C₂ and for Classifier 3 410, it would be C₃. The process can create the compound features: ≦400 characters AND click” with weight C₁. This is a feature that occurs only if the word click appears in a message with ≦400 characters. Similarly, the process can have “Number of recipients≦2 and >400 characters and word click”with weight C₂ which would be true if the word click occurred in a short message with at most 2 recipients. Similarly, the process can create a compound feature for “click” corresponding with weight C₃. If this is done for all words, then the resulting model is a linear model, with the same performance as the decision tree of linear classifiers.

This equivalency can be employed to build even more interesting models. For example, the process can build a decision tree in the way described supra. The process can then create compound features for all nodes, including internal nodes. A single model can then be learned for this set of compound features. This is a similar way of alleviating the data sparsity problem. The resulting model is a linear model at least as powerful as the decision tree model.

Decision Trees for Spam Filtering

Machine learning techniques can be utilized to construct a decision tree that partitions messages into sets and then learns a separate filter on the messages in each of these partitions. For example, HTML (hyper text markup language) messages can be partitioned from plain text ones and a separate model learned for each of them. Utilizing this process can increase spam detection by as much as 20% over current spam filters that utilize text features alone. Employing decision trees can also increase the accuracy of sets of messages when different properties can be found, specifically where things learned from messages of one set do not generalize well to messages of the other types. This can happen for messages of different languages, for messages of different sizes, and/or for messages with different encodings, etc. Decision trees also allow training with more email because a large set of email can be partitioned into many smaller sets, and MaxEnt training only needs to be applied on these partitions (and not on the whole data set).

Feature Description

Decision trees are a well known and much studied technique for classifying data (see, Breiman, Friedman, Olshen, and Stone; Classification and Regression Trees Wadsworth & Brooks; Monterey Calif.; 1984 and Quinlan; C4. 5: programs for machine learning; Morgan Kaufmann; San Francisco, Calif.; 1993). However, the subject matter herein employs a decision tree to partition email messages into sets that have similar feature properties and then train separate models using classifiers on each of these sets. By employing classifier models built using decision trees, for example, a 20% increase in spam email detection can be achieved over spam detection by a single monolithic model.

In FIG. 5, an illustration of a sample decision tree 500 is shown. The root 502 and interior 504, 506 nodes contain tests on the attributes of email messages and leaf nodes 508-514 contain linear models (built with a MaxEnt (maximum entropy) algorithm) that estimate the probability a message is spam. The fraction of each leaf node that is shaded 516-522 indicates the fraction of corresponding messages that are spam. When a new message needs to be classified it starts at the root 502 of the decision tree, the attributes of the message are tested and links are followed in the tree until a specific model is reached at a leaf node. The model from the leaf is applied to the message, the resulting probability is compared with the spam confidence thresholds, and appropriate actions taken (e.g., delete the message, move it into a junk folder, etc.).

The power of the decision tree approach is that it allows separation of groups of messages that might otherwise confuse the classifier learning process. For example, if the text ‘font’ appears in an HTML message there is a good chance it is being used to make the display font very tiny—a common trick spammers use to try to confuse spam filters. The same text, ‘font’, in a plain text message cannot possibly change the display font, and thus is probably not a spammer trick. Separating plain text from HTML messages thus allows a more refined way to treat message content, and, thus, do a better job at filtering spam.

The distinction between HTML and plain text messages is intuitively clear, but there are many other potentially useful distinctions (see TABLE 1 infra for a list of example properties/features that can be utilized to partition email into sets). Other existing spam filters can employ data gathering techniques and machine learning algorithms to automatically determine how to partition messages to best filter spam. The algorithm takes as an input a set of email messages that have been labeled as spam or non-spam and a set of properties which should be considered as ways to partition the set of e-mail. The algorithm works roughly as follows. The utility of each partitioning property is estimated by (1) using it to partition the training data, (2) learning classifiers on the data in each of the resulting sets, and (3) recording how well the resulting models distinguish spam from good email. The partitioning property that resulted in the best spam classification is selected and added as a test to the decision tree, and then the learning algorithm is called recursively on the resulting data partitions. The recursion terminates when no further partitioning results in a better model than learning a single model on all the remaining data. TABLE 1 Candidate properties for partitioning messages The content type of the message (plain text, Are there any links or URLs in message HTML, etc.) Message contains an externally linked The size of the message image (“img” and “src” occur The character set of the message somewhere) Message contains an image (“img” occurs Subject starts with “Re:” somewhere in the body) Subject starts with “Fwd:” Message contains an attachment Message appears to be in English The number of header lines (contains at least 3 words from this The number of received header lines list “the a in on of to is are were from The length of the message ID where this that other which why Does the from domain matches the domain when will”) in the first received line Message appears to be in other language The length of the subject (e.g., Spanish) The content encoding type (base64, etc) Message contains an attachment of type X The subject character set (e.g., executable, HTML, JPG, GIF, etc.) Number of recipients to the message (on email) Algorithm Description

TABLE 2 contains an example pseudo-code for the algorithm described supra. The algorithm starts with a tree that has a single leaf node. It recursively grows the tree by adding splits on message properties, partitioning the data according to the splits, and recurring on the partitions until some termination conditions are met. TABLE 2 Pseudo-code for the decision tree building algorithm Inputs: Let T be a set of training messages Let TreeTrain be a set that initially includes elements of T with 70%  probability Let Holdout initially be the set T - TreeTrain Let P be a set of partition properties (for example, the ones listed in Table 1) Let D be the current depth of the recursion, initially 1 Let M be a maximum recursion depth Let DT be an initially empty decision tree Outputs: DT, a decision tree BuildTree(DT, TrainTree, Holdout, P, D, M)  If D ==M   Let DT be a leaf, and return  Build a model on TrainTree    Find the accuracy on Holdout at a 50% probability threshold  For each p in P    Partition Train Tree and Holdout using p    Build a classifier for each of the TrainTree partitions      Find the accuracy on the Holdout partition at 50% threshold    Let the score for f be the weighted classification accuracy of   partitions, where the weights are defined by the fraction of messages   from TreeTrain that are in each partition.   If the best partition score is not better than the TrainTree score   Let DT be a leaf, and return  Else   Let DT be an internal node that splits on the best partition function   p_max   For each child of the split C    Let TrainTree_C and Holdout_C be the associated partitions    BuildTree(C, TrainTree_C, Holdout_C, P − {p_max}, D + 1, M)

Partitionings are evaluated based on their classification accuracy on holdout data. At the beginning of a learning run, each training message is randomly assigned to be part of the TreeTrain set with 70% probability; messages not in TreeTrain are placed into a Holdout set. Each potential partitioning is scored by (1) using it to split the data (both TreeTrain and Holdout), (2) learning a classifier on the training data in each partition, and (3) computing the classification accuracy of model on the partition's holdout data (at the 50% probability threshold). The final score for partitioning the data by one of the properties is the weighted average of the scores of the models built on the data partitions; the weight for each model is simply the fraction of messages used to train that model. The partition function with the highest score is compared to a single classifier model built on all of the training data and evaluated on all of the holdout data. If the single model is better, the recursion along that path is terminated. If one of the partition functions is better, a split based on that partition function is added to the tree, the data is partitioned, and the learning algorithm is called recursively on each partition.

For example, consider the property ‘Message contains an attachment’. To evaluate a split based on this property, all the training messages (from the Train Tree set) that do contain an attachment are put into a set, call it contain_yes, and all the training messages that do not contain an attachment are put into a set, call it contain_no. For the sake of the example, suppose 40% of the data is in contain_yes and 60% of the data is in contain_no. A classifier is then built on the data in each of these sets and one is also built on all of the data in TreeTrain. The holdout data is then split into sets in a similar manner; call these sets h_contain_Yes and h_contain_no. The three models are evaluated by determining their classification accuracy on their respective holdout sets. Suppose that the model built on contain_yes achieves 80% accuracy on the data in h_contain_yes, the model built on contain_no achieves 100% accuracy on the data in h_contain_no, and the model built on TrainTree achieves 90% accuracy on the data in Holdout. The score for the ‘Message contains an attachment’ partitioning property is the weighted average of the model built on contain_yes and the one build on contain_no, and is 0.92 (that is: 0.4* 0.8 +0.6*1.0). The score for the partition is better than the score for the single monolithic model and so a split is put in the tree and the algorithm is called recursively on the data in contain_yes and contain_no. The algorithm evaluates partitions based on all of the properties and selects the best (while this example only evaluated a partition on a single property).

This algorithm has two types of features for each message: the partition properties and the Text/IP/hostname features that are used by the classifier. Partition properties are used as tests in internal nodes of the decision tree, and the Text/IP/hostname features are used in the classifier models at the leaves. The Text/IP/hostname features can be utilized as tests in the decision tree, but doing so introduces additional complexities.

Some of the message properties utilized for partitioning take numeric values (e.g., message size is expressed in bytes). For such attributes the learning algorithm considers partitioning data based on a series of thresholds and selects the threshold that works best. Thresholds are chosen empirically based on the distribution of the properties values in the training data. For example, for the size attribute, the algorithm can consider: splitting messages<1000 bytes from those≧1000 bytes; splitting messages<4000 bytes from those ≧4000 bytes; etc.

Some of the message properties utilized for partitioning have more than two values (e.g., the character set of the message). For such properties the learning algorithm considers a binary split for each possible value. For example, it considers: splitting all messages in US-ASCII from all other messages; splitting all messages in ANSI/OEM Japanese from all other messages; etc.

Decision Tree Based Examples

In one example experiment, training data was utilized from the 300,000 messages before a certain date and the testing data consisted of 40,000 messages from a period occurring two weeks later. Tree training was carried out using 50,000 features to score the MaxEnt models at the leaves. Once the structure of the decision tree was fixed, 500,000 features were evenly divided among the leaves of the decision tree and learned models that utilized MaxEnt code. For example, if the learned decision tree had 10 leaves, a MaxEnt model with 50,000 features is learned for each of them.

TABLE 2 shows the attributes that were considered for splitting on in the experiments. Notice that this is a subset of the attributes listed in TABLE 1. All of the attributes shown in TABLE 2 were used for learning a depth 5 tree, except for the length of the messageID. The features listed in TABLE 2 are roughly in order of value that they added to the decision tree. TABLE 2 Attributes considered for split in the experiments The content encoding type (base64, etc) The number of received header lines The character set of the message The content type of the message (plain text, HTML, etc.) The subject character set Does the from domain matches the domain in the first received line The size of the message Number of recipients to the message The length of the message ID

FIG. 6 illustrates a graph 600 that depicts the results of using the decision tree learning algorithm to improve the performance on text data. The decision tree based models all performed substantially better than the monolithic model, yielding gains of as much as 20% near the email delete threshold and 5% near the email move threshold. FIG. 7 shows the splits learned for the depth 5 decision tree. The decision trees learned at other depths were subtrees of this tree. (For example, FIG. 5 shows the depth 3 tree, which exactly matches the top several levels of the depth 5 tree.)

TABLE 3 shows summary information about the decision trees learned with different depth limits. For example, depth 4 appeared to give the best results for this scenario. TABLE 3 Summary of trees by depth limit FN FN Time to Tree Improvement Improvement Learn Tree Depth Email Delete Email Move (hh:mm) 2 — —  4:10 3 17.6% 4.5%  7:11 4 21.2% 7.7% 10:06 5 19.9% 5.8% 12:25 Alternative Implementations

There is an alternative implementation strategy that results in a single model (instead of a decision tree with one model at each leaf). This can be easier to display to clients and, in some situations, it can have better results than the implementation described supra. Models can be built utilizing data from very different time periods and a determination made as to how much the structure of the learned decision tree changes over time. If it changes a substantial amount, it is indicative of the necessity to build new decision trees regularly. If it does not, then less frequent updates to the decision tree can be adequate to maintain performance. Models can also be built utilizing up-to-date IP features. An application can be written to extract all the features from, for example, TABLE 1 to determine if they facilitate the process. However, if they do not help, the learning algorithm automatically determines this and does not use them.

Splits can be evaluated based on their classification accuracy at thresholds of concern. Models can be learned using different sigma squared values. It is possible that a value determined to be best for text data (e.g., 0.001) can be magnitudes off of a best value for decision trees (e.g., 1.0). A set of holdout users can be constructed instead of a set of holdout data. Two messages to the same person can have important hints inside the messages (e.g., the person's name) which a learner can key off of, and build a model that does not generalize well across users.

Words and/or phrases can be utilized to partition data. For example, a model can be learned for all messages with the phrase ‘order confirmation’ in it, and one model for all other messages. Partitioning can be based on the presence of any token output by a cracking process, or a list of candidate words and phrases, or both can be handcrafted.

Utilizing Linear Models with Trees

Different types of linear classifiers can be utilized in a decision tree for detecting email spam. In general, weighted sums of email features are determined and compared to a threshold value, forming a linear model. For example, lists of “spam-like” and “non-spam-like” words can be created. A good example of a spam-like word is “wet” and a good example of a non-spam-like word is “weather.” Weights—numbers—to be associated with each of these words are then learned. The more spam-like a word is, the larger the weight. In addition to word-based features, other features can be utilized as well, such as the time of day when the message was sent (spam is typically more likely to be sent at night). Weights are associated with these other features as well. Generally, any message information can have an associated weight.

When a new email is partitioned via a decision tree to a linear classifier leaf, the list of features in that message is determined (i.e., what words are present, etc.) and then all the weights associated with those features are summed. If the total weight is more than a threshold value, the email is labeled as spam. If it is less than that value, the email is labeled as good. The total weight can also be converted into a probability and then compared to a threshold. The probability is derived from the total weight, and so is representative of utilizing the weights directly.

Feature sets can be relatively simple. Specific words in an email tend to be among the most important features. Typically, features also tend to be binary—that is, either the feature is present, or it is not. For example, a feature can be whether the word “wet” occurs in an email and whether the word “weather” occurs in an email. Phrases can also be utilized as features. For example, “SEE YOU,” “NEXT WEEK,” and “SCHEDULED FOR” phrases tend to indicate that an email is not spam, while the phrases like “MAKE MONEY” and “DEAR FRIEND” tend to indicate that an email is spam. Features can also include distinguishing between whether a word occurs in the subject or the body of an email. For example, if the word “QUESTION” occurs in the subject of an email, it tends to indicate not-spam, while if it occurs in the body, it tends to indicate spam. Additional types of features can be utilized as well. These include, for example, whether the email has attachments, how large the email is, whether there are non-alphanumeric words in the email body or in the subject, how many recipients of the email there are, the time the email was sent, whether there are all uppercase words in the email body or subject, the percentage of uppercase words in the body, and/or the percentage of non-alphanumeric characters in the body and the like.

In general, it is not practicable to utilize, for example, every word that occurs in every email as a feature—there are simply too many. However, there are a number of techniques for determining which words to use. One technique is called “mutual information” which measures how much information a word gives about whether or not an email is spam. A word that occurs only in spam or only in good messages has high mutual information; a word that occurs equally often in spam and non-spam has zero mutual information. Frequently, mutual information favors rare words (a word that only occurs a few times but always in good mail or spam has high mutual information).

The values or weights assigned to these features can also be determined by applying specific algorithms such as with support vector machine (SVM) techniques. The basic idea of SVM techniques is to find a set of weights such that all the spam email is above a threshold and all the good email is below that threshold. SVM techniques have the property that spam emails are as far above the threshold as possible and the non-spam is as far below as possible. A perfect separator between spam and good emails can be difficult to determine due to such factors as, for example, mislabeled training data and/or the problem is inherently very hard (e.g., a friend forwards spam email to a user which can be associated as non-spam, but the contents looks substantially like spam).

The SVM techniques determine the best weights and determine a maximal separation of good and spam emails. SVM algorithms that are robust to misclassifications can also be employed even when there is not a perfect separation of email types. In that case, the SVM algorithm finds a line that does as good a job as possible. However, users typically do not want to miss any of their wanted email, so the threshold that the SVM finds is generally too aggressive for most users. For emails that are right on the threshold, there is about a 50% chance that an email has been misclassified. Fortunately, the further the emails are from the threshold, the less likely it is that the email is misclassified. Thus, a separation line can be selected with the same slope (same weights) but a different, more conservative threshold. Some spam may reach a user, but the probability of filtering out legitimate emails is substantially reduced.

The distance from the optimal split is a useful way to estimate the probability that an email is spam. When a message is substantially near this threshold, it is difficult to determine if the email spam or not—the probability is 50/50. As the emails get further and further from this line, the probability increases. The distance from this line is the sum of the weights, minus the threshold value—when the distance is zero (right on the threshold), the probability is 50/50. An example function for mapping this distance is: exp(a×distance+b)/(1+exp(a×distance+b))   (Eq. 1) where exp is the exponentiation function, and a and b are constants. The constants can be determined, for example, by utilizing an algorithm that considers how many points in the training data are on the wrong side of the line and how far various points are from the line. The threshold can be set in terms of the probability, rather than in terms of any particular distance. For example, a probability threshold of 96.5% can classify approximately 60% of the email as spam, and misses almost none of the wanted mail. User interfaces can be utilized to allow users to control how aggressive the filter is. Thus, the user can adjust the probability threshold, with a default setting of 96.5% being good. But, users who want to be more aggressive or more conservative can adjust it in either direction.

In view of the exemplary systems shown and described above, methodologies that may be implemented in accordance with the embodiments will be better appreciated with reference to the flow charts of FIGS. 8-10. While, for purposes of simplicity of explanation, the methodologies are shown and described as a series of blocks, it is to be understood and appreciated that the embodiments are not limited by the order of the blocks, as some blocks may, in accordance with an embodiment, occur in different orders and/or concurrently with other blocks from that shown and described herein. Moreover, not all illustrated blocks may be required to implement the methodologies in accordance with the embodiments.

The embodiments may be described in the general context of computer-executable instructions, such as program modules, executed by one or more components. Generally, program modules include routines, programs, objects, data structures, etc., that perform particular tasks or implement particular abstract data types. Typically, the functionality of the program modules may be combined or distributed as desired in various instances of the embodiments.

In FIG. 8, a flow diagram of a method 800 of facilitating email classification in accordance with an aspect of an embodiment is shown. The method 800 starts 802 by obtaining at least one email from a source 804. The source can include, but is not limited to, an online email account and/or an email storage device and the like. “Email” can include text messages, HTML messages, and/or graphical messages and the like. A decision tree of classifiers is then utilized to determine whether the email is spam 806, ending the flow 808. The decision tree utilizes detected features of the obtained email to facilitate in classifying the email. The tree facilitates optimum selection of a classifier for the email via utilization of nodes based on email features that allow splits to tree leaves containing separate classifiers. The leaves (classifiers) can be tailored to a specific email feature. The classifiers themselves can be different types such as, for example, linear classifiers and/or even other decision trees and the like. Linear classifiers can include, but are not limited to, support vector machines (SVM) and/or logistic-regression classifiers and the like.

Turning to FIG. 9, a flow diagram of a method 900 of constructing an email decision tree that facilitates email classification in accordance with an aspect of an embodiment is depicted. The method 900 starts 902 by determining a feature set for emails to utilize as nodes of a decision tree 904. Features of the emails can include, but are not limited to, message length, text font size, word choice, sender, time-of-day received, and/or subject line and the like. A classifier for each feature is then determined to utilize as leaves of the decision tree 906. The classifiers themselves can be different types such as, for example, linear classifiers and/or even other decision trees and the like. Linear classifiers can include, but are not limited to, support vector machines (SVM) and/or logistic-regression classifiers and the like. The decision tree is then constructed utilizing the feature set and classifiers 908, ending the flow 910. One skilled in the art will appreciate that training data can also be utilized in the construction of the decision tree to facilitate in optimizing its performance.

Looking at FIG. 10, a flow diagram of a method 1000 of constructing classifiers for utilization in email classification in accordance with an aspect of an embodiment is illustrated. The method 1000 starts 1002 by constructing a classifier model utilizing a linear model if desired 1004. The linear models can include, but are not limited to, support vector machines (SVM) and/or logistic-regression classifiers and the like. A classifier model is then constructed utilizing a decision tree if desired 1006. Decision trees themselves can be utilized as leaves (classifiers) of other decision trees. A classifier model for a node of a decision tree is then constructed utilizing a classifier model constructed for another node of the decision tree if desired 1008. To facilitate smoothing of email classification (especially in sparse data environments), classifier models can be utilized to build leaves for additional nodes of the decision tree. A linear classifier model is then constructed utilizing compound features based on nodes of a decision tree with or without employing internal nodes of the decision tree if desired 1010. The linear model can achieve substantially the same or better performance than the decision tree. The constructed classifier models are then employed to facilitate detection of spam emails 1012, ending the flow 1014. The various classifier models constructed above allow a spam detection filter to have flexibility, not only in providing specific classifiers for specific email features, but also to compensate for data sparsity and computation limitations and the like while providing increased detection performance.

In order to provide additional context for implementing various aspects of the embodiments, FIG. 11 and the following discussion is intended to provide a brief, general description of a suitable computing environment 1100 in which the various aspects of the embodiments may be implemented. While the embodiments have been described above in the general context of computer-executable instructions of a computer program that runs on a local computer and/or remote computer, those skilled in the art will recognize that the embodiments may also be implemented in combination with other program modules. Generally, program modules include routines, programs, components, data structures, etc., that perform particular tasks and/or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the inventive methods may be practiced with other computer system configurations, including single-processor or multi-processor computer systems, minicomputers, mainframe computers, as well as personal computers, hand-held computing devices, microprocessor-based and/or programmable consumer electronics, and the like, each of which may operatively communicate with one or more associated devices. The illustrated aspects of the embodiments may also be practiced in distributed computing environments where certain tasks are performed by remote processing devices that are linked through a communications network. However, some, if not all, aspects of the embodiments may be practiced on stand-alone computers. In a distributed computing environment, program modules may be located in local and/or remote memory storage devices.

As used in this application, the term “component” is intended to refer to a computer-related entity, either hardware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and a computer. By way of illustration, an application running on a server and/or the server can be a component. In addition, a component may include one or more subcomponents.

With reference to FIG. 11, an exemplary system environment 1100 for implementing the various aspects of the embodiments include a conventional computer 1102, including a processing unit 1104, a system memory 1106, and a system bus 1108 that couples various system components, including the system memory, to the processing unit 1104. The processing unit 1104 may be any commercially available or proprietary processor. In addition, the processing unit may be implemented as multi-processor formed of more than one processor, such as may be connected in parallel.

The system bus 1108 may be any of several types of bus structure including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of conventional bus architectures such as PCI, VESA, Microchannel, ISA, and EISA, to name a few. The system memory 1106 includes read only memory (ROM) 1110 and random access memory (RAM) 1112. A basic input/output system (BIOS) 1114, containing the basic routines that help to transfer information between elements within the computer 1102, such as during start-up, is stored in ROM 1110.

The computer 1102 also may include, for example, a hard disk drive 1116, a magnetic disk drive 1118, e.g., to read from or write to a removable disk 1120, and an optical disk drive 1122, e.g., for reading from or writing to a CD-ROM disk 1124 or other optical media. The hard disk drive 1116, magnetic disk drive 1118, and optical disk drive 1122 are connected to the system bus 1108 by a hard disk drive interface 1126, a magnetic disk drive interface 1128, and an optical drive interface 1130, respectively. The drives 1116-1122 and their associated computer-readable media provide nonvolatile storage of data, data structures, computer-executable instructions, etc. for the computer 1102. Although the description of computer-readable media above refers to a hard disk, a removable magnetic disk and a CD, it should be appreciated by those skilled in the art that other types of media which are readable by a computer, such as magnetic cassettes, flash memory cards, digital video disks, Bernoulli cartridges, and the like, can also be used in the exemplary operating environment 1100, and further that any such media may contain computer-executable instructions for performing the methods of the embodiments.

A number of program modules may be stored in the drives 1116-1122 and RAM 1112, including an operating system 1132, one or more application programs 1134, other program modules 1136, and program data 1138. The operating system 1132 may be any suitable operating system or combination of operating systems. By way of example, the application programs 1134 and program modules 1136 can include an email classification scheme in accordance with an aspect of an embodiment.

A user can enter commands and information into the computer 1102 through one or more user input devices, such as a keyboard 1140 and a pointing device (e.g., a mouse 1142). Other input devices (not shown) may include a microphone, a joystick, a game pad, a satellite dish, a wireless remote, a scanner, or the like. These and other input devices are often connected to the processing unit 1104 through a serial port interface 1144 that is coupled to the system bus 1108, but may be connected by other interfaces, such as a parallel port, a game port or a universal serial bus (USB). A monitor 1146 or other type of display device is also connected to the system bus 1108 via an interface, such as a video adapter 1148. In addition to the monitor 1146, the computer 1102 may include other peripheral output devices (not shown), such as speakers, printers, etc.

It is to be appreciated that the computer 1102 can operate in a networked environment using logical connections to one or more remote computers 1160. The remote computer 1160 may be a workstation, a server computer, a router, a peer device or other common network node, and typically includes many or all of the elements described relative to the computer 1102, although for purposes of brevity, only a memory storage device 1162 is illustrated in FIG. 11. The logical connections depicted in FIG. 11 can include a local area network (LAN) 1164 and a wide area network (WAN) 1166. Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets and the Internet.

When used in a LAN networking environment, for example, the computer 1102 is connected to the local network 1164 through a network interface or adapter 1168. When used in a WAN networking environment, the computer 1102 typically includes a modem (e.g., telephone, DSL, cable, etc.) 1170, or is connected to a communications server on the LAN, or has other means for establishing communications over the WAN 1166, such as the Internet. The modem 1170, which can be internal or external relative to the computer 1102, is connected to the system bus 1108 via the serial port interface 1144. In a networked environment, program modules (including application programs 1134) and/or program data 1138 can be stored in the remote memory storage device 1162. It will be appreciated that the network connections shown are exemplary and other means (e.g., wired or wireless) of establishing a communications link between the computers 1102 and 1160 can be used when carrying out an aspect of an embodiment.

In accordance with the practices of persons skilled in the art of computer programming, the embodiments have been described with reference to acts and symbolic representations of operations that are performed by a computer, such as the computer 1102 or remote computer 1160, unless otherwise indicated. Such acts and operations are sometimes referred to as being computer-executed. It will be appreciated that the acts and symbolically represented operations include the manipulation by the processing unit 1104 of electrical signals representing data bits which causes a resulting transformation or reduction of the electrical signal representation, and the maintenance of data bits at memory locations in the memory system (including the system memory 1106, hard drive 1116, floppy disks 1120, CD-ROM 1124, and remote memory 1162) to thereby reconfigure or otherwise alter the computer system's operation, as well as other processing of signals. The memory locations where such data bits are maintained are physical locations that have particular electrical, magnetic, or optical properties corresponding to the data bits.

FIG. 12 is another block diagram of a sample computing environment 1200 with which embodiments can interact. The system 1200 further illustrates a system that includes one or more client(s) 1202. The client(s) 1202 can be hardware and/or software (e.g., threads, processes, computing devices). The system 1200 also includes one or more server(s) 1204. The server(s) 1204 can also be hardware and/or software (e.g., threads, processes, computing devices). One possible communication between a client 1202 and a server 1204 may be in the form of a data packet adapted to be transmitted between two or more computer processes. The system 1200 includes a communication framework 1208 that can be employed to facilitate communications between the client(s) 1202 and the server(s) 1204. The client(s) 1202 are connected to one or more client data store(s) 1210 that can be employed to store information local to the client(s) 1202. Similarly, the server(s) 1204 are connected to one or more server data store(s) 1206 that can be employed to store information local to the server(s) 1204.

It is to be appreciated that the systems and/or methods of the embodiments can be utilized in email classification facilitating computer components and non-computer related components alike. Further, those skilled in the art will recognize that the systems and/or methods of the embodiments are employable in a vast array of electronic related technologies, including, but not limited to, computers, servers and/or handheld electronic devices, and the like.

What has been described above includes examples of the embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of the embodiments are possible. Accordingly, the subject matter is intended to embrace all such alterations, modifications and variations that fall within the spirit and scope of the appended claims. Furthermore, to the extent that the term “includes” is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term “comprising” as “comprising” is interpreted when employed as a transitional word in a claim. 

1. A system that facilitates classification of electronic mail, comprising: a feature detection component that detects at least one feature of at least one obtained email; and a decision tree classification component that classifies the obtained email based on, at least in part, the features of the obtained email and at least one feature classifier employed via a decision tree.
 2. The system of claim 1, the decision tree classification component determines whether an email is spam.
 3. The system of claim 1, the decision tree classification component utilizes at least one linear classifier.
 4. The system of claim 2, the linear classifier comprising a logistic-regression classifier.
 5. The system of claim 2, the linear classifier comprising a support vector machine (SVM).
 6. The system of claim 1, the decision tree classification component utilizes at least one classifier constructed from a decision tree.
 7. The system of claim 1, the decision tree classification component smoothes at least one classification result via employment of at least one classifier that is based on, at least in part, at least one other classifier utilized in at least one other node of the decision tree.
 8. The system of claim 1, the decision tree classification component employs a linear classifier constructed from compound features based on, at least in part, nodes of the decision tree.
 9. The system of claim 8, the compound features based on, at least in part, at least one internal node of the decision tree.
 10. A method for facilitating classification of electronic mail, comprising: obtaining an email from a source; and utilizing a decision tree of classifier models to detect whether the email is spam.
 11. The method of claim 10 further comprising: employing a linear model as at least one classifier of the decision tree.
 12. The method of claim 11, the linear model comprising a logistic-regression model.
 13. The method of claim 11, the linear model comprising a support vector machine (SVM).
 14. The method of claim 10 further comprising: employing a decision tree as at least one classifier of the decision tree.
 15. The method of claim 10 further comprising: smoothing at least one detection result utilizing a classifier model that incorporates, at least in part, a classifier model built for another node of the decision tree.
 16. The method of claim 10 further comprising: employing at least one linear model constructed from compound features that are based on, at least in part, nodes of the decision tree.
 17. The method of claim 16 further comprising: constructing compound features based on, at least in part, at least one internal node of the decision tree.
 18. A system that facilitates classification of electronic mail, comprising: means for detecting features of at least one obtained email; and means for classifying the obtained email based on, at least in part, the features of the obtained email and at least one feature classifier employed via a decision tree.
 19. A device employing the method of claim 10 comprising at least one selected from the group consisting of a computer, a server, and a handheld electronic device.
 20. A device employing the system of claim 1 comprising at least one selected from the group consisting of a computer, a server, and a handheld electronic device. 